var findMix = function(nums){
  if(nums.length === 1)
    return nums[0]
  let left = 0
  let right = nums.length-1
  let mid = Math.floor(left + (right - left)/2);
  if(nums[right] > nums[0])
    return nums[0]
  while(left < right){
    if(nums[mid] >nums[mid+1]){
      return nums[mid+1]
    }
   if(nums[mid] < nums[mid-1]){
      return nums[mid]
    }

    if(nums[mid] >nums[left]){
      left = mid+1;
  }else{
    right = mid-1;
  }
  
}
}